Ext.onReady(function(){
    Ext.BLANK_IMAGE_URL = '../lib/resources/images/default/tree/s.gif';
	var data={
		text: 'Ext JS',
        expanded: true,
        children: [{
            text: '结点一',
            leaf: true,
            url:'a.html'
        }, {
            text: '结点二',
            children: [{
                text: '结点三',
				url:'b.html',
                leaf: true
            }, {
                text: '还有啊',
				url:'c.html',
                leaf: true
            }, {
                text: '真的',
				url:'d.html',
                leaf:true
            }]
        }, {
            text: '最下面的结点',
            id: 'min',
            leaf: true
        }]
	}
    var nodes = new Ext.tree.AsyncTreeNode(data);
    var nodes1 = new Ext.tree.AsyncTreeNode(data);
    
	new QM.ui.TreeCombo({
		maxHeight: 100,
        applyTo: 'combo1',
        xtype: 'treecombo',
        value: '1102',
        lazyInit: false,
        editable: false, //如果树中结点不是一次全部加载请请此项设为false
        tree: {
            loader: new Ext.ux.tree.JsonTreeLoader({
                root: 'menus',
                url: 'menu.json'
            }),
            root: new Ext.tree.AsyncTreeNode()
        }
    });
	
	new QM.ui.TreeCombo({
        applyTo: 'combo2',
        xtype: 'treecombo',
        value: '1102',
		width : 144,
		listWidth: 144,
        tree: {
            loader: new Ext.ux.tree.JsonTreeLoader({
                root: 'menus',
                url: 'menu.json'
            }),
            root: new Ext.tree.AsyncTreeNode()
        }
    });
	new QM.ui.TreeCombo({
        applyTo: 'combo3',
        xtype: 'treecombo',
        value: 'min',
        tree: {
            root:nodes1
        }
    });
	
	new QM.ui.TreeCombo({
        applyTo: 'combo4',
        xtype: 'treecombo',
		lazyInit: false,
        tree: {
            root:nodes
        }
    });
})
